package Payment;

/**
 * CreditPayment extends of Payment class/ for customer choose to pay by credit
 * @author Sara Pulis
 */
public class CreditPayment extends Payment{

    private int cardNumber;

    public CreditPayment() {
        type = "Credit";
    }

    public CreditPayment(float total, int number) {
        type = "Cash";
        cardNumber = number;
        transactionTotal = total;
    }

    public String toString() {
        return ("Credit Card " + cardNumber);
    }

    @Override
    public float getTotal() {
        return transactionTotal;
    }

    @Override
    public boolean verify() {
        int random = (int) (Math.random() * 10);
        if (random <= 1) {
            return false;
        } else {
            return true;
        }
    }

    @Override
    public float getChange() {
        return 0;
    }


}